<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.20"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>The small3d library: small3d::Image Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="customdoxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo_s.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">The small3d library
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.20 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespacesmall3d.html">small3d</a></li><li class="navelem"><a class="el" href="classsmall3d_1_1_image.html">Image</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-attribs">Static Public Attributes</a> &#124;
<a href="classsmall3d_1_1_image-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">small3d::Image Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>An image, loaded from a .png file, which can be used for generating textures.  
 <a href="classsmall3d_1_1_image.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_image_8hpp_source.html">Image.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:afe8aec09a44cfc52975166d930466dea"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_image.html#afe8aec09a44cfc52975166d930466dea">Image</a> (const std::string fileLocation=&quot;&quot;)</td></tr>
<tr class="memdesc:afe8aec09a44cfc52975166d930466dea"><td class="mdescLeft">&#160;</td><td class="mdescRight">File-reading constructor.  <a href="classsmall3d_1_1_image.html#afe8aec09a44cfc52975166d930466dea">More...</a><br /></td></tr>
<tr class="separator:afe8aec09a44cfc52975166d930466dea"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae3c2a88cea4d2628cfb801f9ae414c8e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_image.html#ae3c2a88cea4d2628cfb801f9ae414c8e">Image</a> (std::vector&lt; char &gt; &amp;data)</td></tr>
<tr class="memdesc:ae3c2a88cea4d2628cfb801f9ae414c8e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Memory-based constructor.  <a href="classsmall3d_1_1_image.html#ae3c2a88cea4d2628cfb801f9ae414c8e">More...</a><br /></td></tr>
<tr class="separator:ae3c2a88cea4d2628cfb801f9ae414c8e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afd4336c0afa2ec91f144da3bb17dc9ef"><td class="memItemLeft" align="right" valign="top"><a id="afd4336c0afa2ec91f144da3bb17dc9ef"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_image.html#afd4336c0afa2ec91f144da3bb17dc9ef">~Image</a> ()=default</td></tr>
<tr class="memdesc:afd4336c0afa2ec91f144da3bb17dc9ef"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <br /></td></tr>
<tr class="separator:afd4336c0afa2ec91f144da3bb17dc9ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a619d1f2f4c5e4e8c973abcd6b7d03aa5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_image.html#a619d1f2f4c5e4e8c973abcd6b7d03aa5">toColour</a> (glm::vec4 colour)</td></tr>
<tr class="memdesc:a619d1f2f4c5e4e8c973abcd6b7d03aa5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert to a coloured 10 x 10 pixel image.  <a href="classsmall3d_1_1_image.html#a619d1f2f4c5e4e8c973abcd6b7d03aa5">More...</a><br /></td></tr>
<tr class="separator:a619d1f2f4c5e4e8c973abcd6b7d03aa5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a335588f99053b1f55c15c60c76c26624"><td class="memItemLeft" align="right" valign="top">unsigned long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_image.html#a335588f99053b1f55c15c60c76c26624">getWidth</a> () const</td></tr>
<tr class="memdesc:a335588f99053b1f55c15c60c76c26624"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the image width.  <a href="classsmall3d_1_1_image.html#a335588f99053b1f55c15c60c76c26624">More...</a><br /></td></tr>
<tr class="separator:a335588f99053b1f55c15c60c76c26624"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adf097899bb8212b43a6e620ff0d15007"><td class="memItemLeft" align="right" valign="top">unsigned long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_image.html#adf097899bb8212b43a6e620ff0d15007">getHeight</a> () const</td></tr>
<tr class="memdesc:adf097899bb8212b43a6e620ff0d15007"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the image height.  <a href="classsmall3d_1_1_image.html#adf097899bb8212b43a6e620ff0d15007">More...</a><br /></td></tr>
<tr class="separator:adf097899bb8212b43a6e620ff0d15007"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2ca91e211b1f2eb978def755cb1821f3"><td class="memItemLeft" align="right" valign="top">unsigned long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_image.html#a2ca91e211b1f2eb978def755cb1821f3">getByteSize</a> () const</td></tr>
<tr class="memdesc:a2ca91e211b1f2eb978def755cb1821f3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the size of the image, in bytes.  <a href="classsmall3d_1_1_image.html#a2ca91e211b1f2eb978def755cb1821f3">More...</a><br /></td></tr>
<tr class="separator:a2ca91e211b1f2eb978def755cb1821f3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab26bc22464edb7aefbcd4a2b95d788a2"><td class="memItemLeft" align="right" valign="top">const float *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_image.html#ab26bc22464edb7aefbcd4a2b95d788a2">getData</a> () const</td></tr>
<tr class="memdesc:ab26bc22464edb7aefbcd4a2b95d788a2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the image data.  <a href="classsmall3d_1_1_image.html#ab26bc22464edb7aefbcd4a2b95d788a2">More...</a><br /></td></tr>
<tr class="separator:ab26bc22464edb7aefbcd4a2b95d788a2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr class="memitem:ae8ebe48834ff700dff0f3f30983b70bd"><td class="memItemLeft" align="right" valign="top"><a id="ae8ebe48834ff700dff0f3f30983b70bd"></a>
static const std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_image.html#ae8ebe48834ff700dff0f3f30983b70bd">NOTRGBA</a> = &quot;Image format not recognised. Only RGB / RGBA png images are supported.&quot;</td></tr>
<tr class="memdesc:ae8ebe48834ff700dff0f3f30983b70bd"><td class="mdescLeft">&#160;</td><td class="mdescRight">String saying that the colour encoding of the image being read is not RGB/RGBA. <br /></td></tr>
<tr class="separator:ae8ebe48834ff700dff0f3f30983b70bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>An image, loaded from a .png file, which can be used for generating textures. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="afe8aec09a44cfc52975166d930466dea"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afe8aec09a44cfc52975166d930466dea">&#9670;&nbsp;</a></span>Image() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">small3d::Image::Image </td>
          <td>(</td>
          <td class="paramtype">const std::string&#160;</td>
          <td class="paramname"><em>fileLocation</em> = <code>&quot;&quot;</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>File-reading constructor. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">fileLocation</td><td>Location of the png image file </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ae3c2a88cea4d2628cfb801f9ae414c8e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae3c2a88cea4d2628cfb801f9ae414c8e">&#9670;&nbsp;</a></span>Image() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">small3d::Image::Image </td>
          <td>(</td>
          <td class="paramtype">std::vector&lt; char &gt; &amp;&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Memory-based constructor. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>PNG bytes already read into memory </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a2ca91e211b1f2eb978def755cb1821f3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2ca91e211b1f2eb978def755cb1821f3">&#9670;&nbsp;</a></span>getByteSize()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned long small3d::Image::getByteSize </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the size of the image, in bytes. </p>
<dl class="section return"><dt>Returns</dt><dd>Size of the image, in bytes </dd></dl>

</div>
</div>
<a id="ab26bc22464edb7aefbcd4a2b95d788a2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab26bc22464edb7aefbcd4a2b95d788a2">&#9670;&nbsp;</a></span>getData()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const float * small3d::Image::getData </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the image data. </p>
<dl class="section return"><dt>Returns</dt><dd>The image data </dd></dl>

</div>
</div>
<a id="adf097899bb8212b43a6e620ff0d15007"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adf097899bb8212b43a6e620ff0d15007">&#9670;&nbsp;</a></span>getHeight()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned long small3d::Image::getHeight </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the image height. </p>
<dl class="section return"><dt>Returns</dt><dd>The image height </dd></dl>

</div>
</div>
<a id="a335588f99053b1f55c15c60c76c26624"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a335588f99053b1f55c15c60c76c26624">&#9670;&nbsp;</a></span>getWidth()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned long small3d::Image::getWidth </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the image width. </p>
<dl class="section return"><dt>Returns</dt><dd>The image width </dd></dl>

</div>
</div>
<a id="a619d1f2f4c5e4e8c973abcd6b7d03aa5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a619d1f2f4c5e4e8c973abcd6b7d03aa5">&#9670;&nbsp;</a></span>toColour()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void small3d::Image::toColour </td>
          <td>(</td>
          <td class="paramtype">glm::vec4&#160;</td>
          <td class="paramname"><em>colour</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Convert to a coloured 10 x 10 pixel image. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">colour</td><td>The colour of the image </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="_image_8hpp_source.html">Image.hpp</a></li>
<li>Image.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.8.20
</small></address>
</body>
</html>
